/* SPDX-License-Identifier: GPL-2.0 OR Apache 2.0
 *
 * Copyright (c) 2024 Black Sesame Technologies
 *
 * This program is also distributed under the terms of the Apache 2.0
 * License.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* This file is auto generated for message box v1.1.0.
 * All manual modifications will be LOST by next generation.
 * It is recommended NOT modify it.
 * Generator Version: francaidl c4b9707 msgbx_ipc 1964fef
 */

#ifndef SWITCH0_CAN_GATEWAY_IPC_SERVER_H
#define SWITCH0_CAN_GATEWAY_IPC_SERVER_H

#include "switch0_can_gateway_server.h"

#ifdef __cplusplus
extern "C" {
#endif

struct _switch0_can_gateway_ipc_server_t {
	switch0_can_gateway_server_t switch0_can_gateway_server;

#ifdef IPC_RTE_BAREMETAL
	/**
	 * Receive a message from the server.
	 *
	 * @return 0 if success, negative if fail.
	 */
	int32_t (*receive_message)(void);

	/**
	 * Dispatch a message to the server.
	 *
	 * @return 0 if success, negative if fail.
	 */
	int32_t (*dispatch_message)(void);
#else
	/**
	 * Start the message router.
	 *
	 * @return 0 if success, negative if fail.
	 */
	int32_t (*start)(void);

	/**
	 * Stop the message router.
	 *
	 * @return 0 if success, negative if fail.
	 */
	int32_t (*stop)(void);
#endif
};
#define switch0_can_gateway_ipc_server_t struct _switch0_can_gateway_ipc_server_t


/**
 *  The internal data used by the server.
 *  Users should define an instance and pass it to the server initialization function.
 */
struct _switch0_can_gateway_ipc_server_data_t {
	com_server_data_t com_data;
	switch0_can_gateway_ipc_server_t server;
	switch0_can_gateway_server_ext_t switch0_can_gateway_ext;
};
#define switch0_can_gateway_ipc_server_data_t struct _switch0_can_gateway_ipc_server_data_t

/**
 * Initializes the server.
 *
 * @param ins The instance to be initialized.
 * @return A pointer to the initialized server, NULL if fail.
 */
switch0_can_gateway_ipc_server_t *switch0_can_gateway_ipc_server_init(switch0_can_gateway_ipc_server_data_t *ins);
/**
 * Destroys the server.
 *
 * @return 0 if success, negetive if fail.
 */
int32_t switch0_can_gateway_ipc_server_destroy(void);

#ifdef __cplusplus
}
#endif

#endif // SWITCH0_CAN_GATEWAY_IPC_SERVER_H
